#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<iomanip>
using namespace std;

//ostream& output1(ostream& stream)
//{
//	stream.setf(ios::left);
//	stream << setw(10) << hex << setfill('&');
//	return stream;
//}
//int main()
//{
//	int x;
//	cin >> x;
//	cout<<x << endl;
//	cout << output1 << x << endl;
//	return 0;
//}

//istream& input(istream& in)
//{
//	in >> hex;
//	cout << "Enter number using hex format:" << endl;
//	return in;
//}
//int main()
//{
//	int x;
//	cin >> input >> x;
//	cout << "hex:" <<hex<< x << "------dec:" << dec << x << endl;
//	return 0;
//}

//class Coord {
//private:
//	int x, y;
//public:
//	Coord(int xx = 0, int yy = 0)
//	{
//		x = xx; y = yy;
//	}
//	friend ostream& operator<<(ostream& stream,Coord &ob);
//	
//};
//
//ostream& operator<<(ostream& stream, Coord& ob)
//{
//	stream << ob.x << "," << ob.y << endl;
//	return stream;
//}
//
//int main()
//{
//	Coord a(55, 66), b(100, 200);
//	cout << a<<b;
//	return 0;
//}

class Three_d {
private:
	int x, y, z;
public:
	Three_d(int xx, int yy, int zz)
	{
		x = xx; y = yy; z = zz;
	}
	friend ostream& operator<<(ostream& stream, Three_d& ob);
	friend istream& operator>>(istream& stream, Three_d& ob);
};

ostream& operator<<(ostream& stream, Three_d& ob)
{
	stream << ob.x << "," << ob.y << "," << ob.z << endl;
	return stream;
}

istream& operator>>(istream& stream, Three_d& ob)
{
	cout << "Enter x,y,z value:" << endl;
	stream >> ob.x >> ob.y >> ob.z;
	return stream;
}

int main()
{
	Three_d obj(10, 20, 30);
	cout << obj;
	cin >> obj;
	cout << obj;
	return 0;
}